import { createRouter, createWebHashHistory } from 'vue-router'


const routes = [
  {
    path: '/',
    // 路由懒加载
    component: () => import('@/views/Tools'),
    redirect: '/firstDic',
    children: [
      { path: '/firstDic', component: () => import('@/views/first/FirstDic.vue') },
      { path: '/secondDic', component: () => import('@/views/second/SecondDic.vue') },
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
  // 刷新行为时，回到顶部
  scrollBehavior: () => ({ top: 0 })
})

export default router
